email me at borlaj@portlandschools.org

Loading
notes previous (11/<11) submit the dump links  
 

App Inventor Animation

 

 

HWAI3 (all must do 1-6, advanced 7-9)

  1. Add a canvas to the app with width of "fill parent" and height 400.
  2. Add three balls from the Animation folder to the canvas. Ball1 should move from left of screen to right at 100 pixels a second. Code and test this before you go on.
  3. Ball2 should move top of screen to bottom at 20 pixels a second.
  4. Ball3 should move diagonally top-left to bottom-right at 50 pixels a second. 
  5. Make it so when ball1 gets to right edge, have it appear on the left side.
  6. Make it so all balls 2 and 3 reverse their course when they reach an edge, e.g., when hit right side, go left.
  7. Add "Faster" and "Slower" buttons that change speed of the balls by 10%
  8. Make it so one of the balls changes color every 20 ms. colors. Hint: You can set the PaintColor of a ball (or anything) using either a built-in color or a number. For instance, dark orange is the number -29696. So try setting the PaintColor of the ball in the Screen.Initialize event, then adding 100 to it every 20 ms. For more info on colors, see http://experimental.appinventor.mit.edu/learn/reference/blocks/colors.html.
  9. If top-to-bottom ball hits another ball, have it immediately go back to top.